using Google.ProtocolBuffers;
using Google.ProtocolBuffers.Collections;
using micromsg.Proto;
using System;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Runtime.CompilerServices;
namespace micromsg
{
	[GeneratedCode("ProtoGen", "2.3.0.277"), DebuggerNonUserCode, CompilerGenerated]
	public sealed class GetContactResponse : GeneratedMessageLite<GetContactResponse, GetContactResponse.Builder>
	{
		[GeneratedCode("ProtoGen", "2.3.0.277"), DebuggerNonUserCode, CompilerGenerated]
		public sealed class Builder : GeneratedBuilderLite<GetContactResponse, GetContactResponse.Builder>
		{
			private bool resultIsReadOnly;
			private GetContactResponse result;
			protected override GetContactResponse.Builder ThisBuilder
			{
				get
				{
					return this;
				}
			}
			public override bool IsInitialized
			{
				get
				{
					return this.result.IsInitialized;
				}
			}
			protected override GetContactResponse MessageBeingBuilt
			{
				get
				{
					return this.PrepareBuilder();
				}
			}
			public override GetContactResponse DefaultInstanceForType
			{
				get
				{
					return GetContactResponse.DefaultInstance;
				}
			}
			public BaseResponse BaseResponse
			{
				get
				{
					return this.result.BaseResponse;
				}
				set
				{
					this.SetBaseResponse(value);
				}
			}
			public uint ContactCount
			{
				get
				{
					return this.result.ContactCount;
				}
				set
				{
					this.SetContactCount(value);
				}
			}
			public IPopsicleList<ModContact> ContactListList
			{
				get
				{
					return this.PrepareBuilder().contactList_;
				}
			}
			public int ContactListCount
			{
				get
				{
					return this.result.ContactListCount;
				}
			}
			public IPopsicleList<int> RetList
			{
				get
				{
					return this.PrepareBuilder().ret_;
				}
			}
			public int RetCount
			{
				get
				{
					return this.result.RetCount;
				}
			}
			public Builder()
			{
				this.result = GetContactResponse.DefaultInstance;
				this.resultIsReadOnly = true;
			}
			internal Builder(GetContactResponse cloneFrom)
			{
				this.result = cloneFrom;
				this.resultIsReadOnly = true;
			}
			private GetContactResponse PrepareBuilder()
			{
				if (this.resultIsReadOnly)
				{
					GetContactResponse other = this.result;
					this.result = new GetContactResponse();
					this.resultIsReadOnly = false;
					this.MergeFrom(other);
				}
				return this.result;
			}
			public override GetContactResponse.Builder Clear()
			{
				this.result = GetContactResponse.DefaultInstance;
				this.resultIsReadOnly = true;
				return this;
			}
			public override GetContactResponse.Builder Clone()
			{
				if (this.resultIsReadOnly)
				{
					return new GetContactResponse.Builder(this.result);
				}
				return new GetContactResponse.Builder().MergeFrom(this.result);
			}
			public override GetContactResponse BuildPartial()
			{
				if (this.resultIsReadOnly)
				{
					return this.result;
				}
				this.resultIsReadOnly = true;
				return this.result.MakeReadOnly();
			}
			public override GetContactResponse.Builder MergeFrom(IMessageLite other)
			{
				if (other is GetContactResponse)
				{
					return this.MergeFrom((GetContactResponse)other);
				}
				base.MergeFrom(other);
				return this;
			}
			public override GetContactResponse.Builder MergeFrom(GetContactResponse other)
			{
				return this;
			}
			public override GetContactResponse.Builder MergeFrom(ICodedInputStream input)
			{
				return this.MergeFrom(input, ExtensionRegistry.Empty);
			}
			public override GetContactResponse.Builder MergeFrom(ICodedInputStream input, ExtensionRegistry extensionRegistry)
			{
				this.PrepareBuilder();
				uint num;
				string text;
				while (input.ReadTag(out num, out text))
				{
					if (num == 0u && text != null)
					{
						int num2 = Array.BinarySearch<string>(GetContactResponse._getContactResponseFieldNames, text, StringComparer.get_Ordinal());
						if (num2 < 0)
						{
							this.ParseUnknownField(input, extensionRegistry, num, text);
							continue;
						}
						num = GetContactResponse._getContactResponseFieldTags[num2];
					}
					uint num3 = num;
					if (num3 <= 10u)
					{
						if (num3 == 0u)
						{
							throw InvalidProtocolBufferException.InvalidTag();
						}
						if (num3 == 10u)
						{
							BaseResponse.Builder builder = BaseResponse.CreateBuilder();
							if (this.result.hasBaseResponse)
							{
								builder.MergeFrom(this.BaseResponse);
							}
							input.ReadMessage(builder, extensionRegistry);
							this.BaseResponse = builder.BuildPartial();
							continue;
						}
					}
					else
					{
						if (num3 == 16u)
						{
							this.result.hasContactCount = input.ReadUInt32(ref this.result.contactCount_);
							continue;
						}
						if (num3 == 26u)
						{
							input.ReadMessageArray<ModContact>(num, text, this.result.contactList_, ModContact.DefaultInstance, extensionRegistry);
							continue;
						}
						switch (num3)
						{
						case 32u:
						case 34u:
							input.ReadInt32Array(num, text, this.result.ret_);
							continue;
						}
					}
					if (WireFormat.IsEndGroupTag(num))
					{
						return this;
					}
					this.ParseUnknownField(input, extensionRegistry, num, text);
				}
				return this;
			}
			public GetContactResponse.Builder SetBaseResponse(BaseResponse value)
			{
				ThrowHelper.ThrowIfNull(value, "value");
				this.PrepareBuilder();
				this.result.hasBaseResponse = true;
				this.result.baseResponse_ = value;
				return this;
			}
			public GetContactResponse.Builder SetBaseResponse(BaseResponse.Builder builderForValue)
			{
				ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
				this.PrepareBuilder();
				this.result.hasBaseResponse = true;
				this.result.baseResponse_ = builderForValue.Build();
				return this;
			}
			public GetContactResponse.Builder MergeBaseResponse(BaseResponse value)
			{
				ThrowHelper.ThrowIfNull(value, "value");
				this.PrepareBuilder();
				if (this.result.hasBaseResponse && this.result.baseResponse_ != BaseResponse.DefaultInstance)
				{
					this.result.baseResponse_ = BaseResponse.CreateBuilder(this.result.baseResponse_).MergeFrom(value).BuildPartial();
				}
				else
				{
					this.result.baseResponse_ = value;
				}
				this.result.hasBaseResponse = true;
				return this;
			}
			public GetContactResponse.Builder ClearBaseResponse()
			{
				this.PrepareBuilder();
				this.result.hasBaseResponse = false;
				this.result.baseResponse_ = null;
				return this;
			}
			public GetContactResponse.Builder SetContactCount(uint value)
			{
				this.PrepareBuilder();
				this.result.hasContactCount = true;
				this.result.contactCount_ = value;
				return this;
			}
			public GetContactResponse.Builder ClearContactCount()
			{
				this.PrepareBuilder();
				this.result.hasContactCount = false;
				this.result.contactCount_ = 0u;
				return this;
			}
			public ModContact GetContactList(int index)
			{
				return this.result.GetContactList(index);
			}
			public GetContactResponse.Builder SetContactList(int index, ModContact value)
			{
				ThrowHelper.ThrowIfNull(value, "value");
				this.PrepareBuilder();
				this.result.contactList_[index] = value;
				return this;
			}
			public GetContactResponse.Builder SetContactList(int index, ModContact.Builder builderForValue)
			{
				ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
				this.PrepareBuilder();
				this.result.contactList_[index] = builderForValue.Build();
				return this;
			}
			public GetContactResponse.Builder AddContactList(ModContact value)
			{
				ThrowHelper.ThrowIfNull(value, "value");
				this.PrepareBuilder();
				this.result.contactList_.Add(value);
				return this;
			}
			public GetContactResponse.Builder AddContactList(ModContact.Builder builderForValue)
			{
				ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
				this.PrepareBuilder();
				this.result.contactList_.Add(builderForValue.Build());
				return this;
			}
			public GetContactResponse.Builder AddRangeContactList(IEnumerable<ModContact> values)
			{
				this.PrepareBuilder();
				this.result.contactList_.Add(values);
				return this;
			}
			public GetContactResponse.Builder ClearContactList()
			{
				this.PrepareBuilder();
				this.result.contactList_.Clear();
				return this;
			}
			public int GetRet(int index)
			{
				return this.result.GetRet(index);
			}
			public GetContactResponse.Builder SetRet(int index, int value)
			{
				this.PrepareBuilder();
				this.result.ret_[index] = value;
				return this;
			}
			public GetContactResponse.Builder AddRet(int value)
			{
				this.PrepareBuilder();
				this.result.ret_.Add(value);
				return this;
			}
			public GetContactResponse.Builder AddRangeRet(IEnumerable<int> values)
			{
				this.PrepareBuilder();
				this.result.ret_.Add(values);
				return this;
			}
			public GetContactResponse.Builder ClearRet()
			{
				this.PrepareBuilder();
				this.result.ret_.Clear();
				return this;
			}
		}
		public const int BaseResponseFieldNumber = 1;
		public const int ContactCountFieldNumber = 2;
		public const int ContactListFieldNumber = 3;
		public const int RetFieldNumber = 4;
		private static readonly GetContactResponse defaultInstance;
		private static readonly string[] _getContactResponseFieldNames;
		private static readonly uint[] _getContactResponseFieldTags;
		private bool hasBaseResponse;
		private BaseResponse baseResponse_;
		private bool hasContactCount;
		private uint contactCount_;
		private PopsicleList<ModContact> contactList_ = new PopsicleList<ModContact>();
		private int retMemoizedSerializedSize;
		private PopsicleList<int> ret_ = new PopsicleList<int>();
		private int memoizedSerializedSize = -1;
		public static GetContactResponse DefaultInstance
		{
			get
			{
				return GetContactResponse.defaultInstance;
			}
		}
		public override GetContactResponse DefaultInstanceForType
		{
			get
			{
				return GetContactResponse.DefaultInstance;
			}
		}
		protected override GetContactResponse ThisMessage
		{
			get
			{
				return this;
			}
		}
		public BaseResponse BaseResponse
		{
			get
			{
				return this.baseResponse_ ?? BaseResponse.DefaultInstance;
			}
		}
		public uint ContactCount
		{
			get
			{
				return this.contactCount_;
			}
		}
		public IList<ModContact> ContactListList
		{
			get
			{
				return this.contactList_;
			}
		}
		public int ContactListCount
		{
			get
			{
				return this.contactList_.Count;
			}
		}
		public IList<int> RetList
		{
			get
			{
				return Lists.AsReadOnly<int>(this.ret_);
			}
		}
		public int RetCount
		{
			get
			{
				return this.ret_.Count;
			}
		}
		public override bool IsInitialized
		{
			get
			{
				if (!this.hasBaseResponse)
				{
					return false;
				}
				if (!this.hasContactCount)
				{
					return false;
				}
				if (!this.BaseResponse.IsInitialized)
				{
					return false;
				}
				bool result;
				using (IEnumerator<ModContact> enumerator = this.ContactListList.GetEnumerator())
				{
					while (enumerator.MoveNext())
					{
						ModContact current = enumerator.get_Current();
						if (!current.IsInitialized)
						{
							result = false;
							return result;
						}
					}
					return true;
				}
				return result;
			}
		}
		public override int SerializedSize
		{
			get
			{
				int num = this.memoizedSerializedSize;
				if (num != -1)
				{
					return num;
				}
				num = 0;
				if (this.hasBaseResponse)
				{
					num += CodedOutputStream.ComputeMessageSize(1, this.BaseResponse);
				}
				if (this.hasContactCount)
				{
					num += CodedOutputStream.ComputeUInt32Size(2, this.ContactCount);
				}
				using (IEnumerator<ModContact> enumerator = this.ContactListList.GetEnumerator())
				{
					while (enumerator.MoveNext())
					{
						ModContact current = enumerator.get_Current();
						num += CodedOutputStream.ComputeMessageSize(3, current);
					}
				}
				int num2 = 0;
				using (IEnumerator<int> enumerator2 = this.RetList.GetEnumerator())
				{
					while (enumerator2.MoveNext())
					{
						int current2 = enumerator2.get_Current();
						num2 += CodedOutputStream.ComputeInt32SizeNoTag(current2);
					}
				}
				num += num2;
				if (this.ret_.Count != 0)
				{
					num += 1 + CodedOutputStream.ComputeInt32SizeNoTag(num2);
				}
				this.retMemoizedSerializedSize = num2;
				this.memoizedSerializedSize = num;
				return num;
			}
		}
		private GetContactResponse()
		{
		}
		public ModContact GetContactList(int index)
		{
			return this.contactList_[index];
		}
		public int GetRet(int index)
		{
			return this.ret_[index];
		}
		public override void WriteTo(ICodedOutputStream output)
		{
			int arg_06_0 = this.SerializedSize;
			string[] getContactResponseFieldNames = GetContactResponse._getContactResponseFieldNames;
			if (this.hasBaseResponse)
			{
				output.WriteMessage(1, getContactResponseFieldNames[0], this.BaseResponse);
			}
			if (this.hasContactCount)
			{
				output.WriteUInt32(2, getContactResponseFieldNames[1], this.ContactCount);
			}
			if (this.contactList_.Count > 0)
			{
				output.WriteMessageArray<ModContact>(3, getContactResponseFieldNames[2], this.contactList_);
			}
			if (this.ret_.Count > 0)
			{
				output.WritePackedInt32Array(4, getContactResponseFieldNames[3], this.retMemoizedSerializedSize, this.ret_);
			}
		}
		public override int GetHashCode()
		{
			int num = base.GetType().GetHashCode();
			if (this.hasBaseResponse)
			{
				num ^= this.baseResponse_.GetHashCode();
			}
			if (this.hasContactCount)
			{
				num ^= this.contactCount_.GetHashCode();
			}
			using (IEnumerator<ModContact> enumerator = this.contactList_.GetEnumerator())
			{
				while (enumerator.MoveNext())
				{
					ModContact current = enumerator.get_Current();
					num ^= current.GetHashCode();
				}
			}
			using (IEnumerator<int> enumerator2 = this.ret_.GetEnumerator())
			{
				while (enumerator2.MoveNext())
				{
					int current2 = enumerator2.get_Current();
					num ^= current2.GetHashCode();
				}
			}
			return num;
		}
		public override bool Equals(object value)
		{
			GetContactResponse getContactResponse = value as GetContactResponse;
			if (getContactResponse == null)
			{
				return false;
			}
			if (this.hasBaseResponse != getContactResponse.hasBaseResponse || (this.hasBaseResponse && !this.baseResponse_.Equals(getContactResponse.baseResponse_)))
			{
				return false;
			}
			if (this.hasContactCount != getContactResponse.hasContactCount || (this.hasContactCount && !this.contactCount_.Equals(getContactResponse.contactCount_)))
			{
				return false;
			}
			if (this.contactList_.Count != getContactResponse.contactList_.Count)
			{
				return false;
			}
			for (int i = 0; i < this.contactList_.Count; i++)
			{
				if (!this.contactList_[i].Equals(getContactResponse.contactList_[i]))
				{
					return false;
				}
			}
			if (this.ret_.Count != getContactResponse.ret_.Count)
			{
				return false;
			}
			for (int j = 0; j < this.ret_.Count; j++)
			{
				if (!this.ret_[j].Equals(getContactResponse.ret_[j]))
				{
					return false;
				}
			}
			return true;
		}
		public override void PrintTo(TextWriter writer)
		{
			GeneratedMessageLite<GetContactResponse, GetContactResponse.Builder>.PrintField("BaseResponse", this.hasBaseResponse, this.baseResponse_, writer);
			GeneratedMessageLite<GetContactResponse, GetContactResponse.Builder>.PrintField("ContactCount", this.hasContactCount, this.contactCount_, writer);
			GeneratedMessageLite<GetContactResponse, GetContactResponse.Builder>.PrintField<ModContact>("ContactList", this.contactList_, writer);
			GeneratedMessageLite<GetContactResponse, GetContactResponse.Builder>.PrintField<int>("Ret", this.ret_, writer);
		}
		public static GetContactResponse ParseFrom(byte[] data)
		{
			return GetContactResponse.CreateBuilder().MergeFrom(data).BuildParsed();
		}
		private GetContactResponse MakeReadOnly()
		{
			this.contactList_.MakeReadOnly();
			this.ret_.MakeReadOnly();
			return this;
		}
		public static GetContactResponse.Builder CreateBuilder()
		{
			return new GetContactResponse.Builder();
		}
		public override GetContactResponse.Builder ToBuilder()
		{
			return GetContactResponse.CreateBuilder(this);
		}
		public override GetContactResponse.Builder CreateBuilderForType()
		{
			return new GetContactResponse.Builder();
		}
		public static GetContactResponse.Builder CreateBuilder(GetContactResponse prototype)
		{
			return new GetContactResponse.Builder(prototype);
		}
		static GetContactResponse()
		{
			GetContactResponse.defaultInstance = new GetContactResponse().MakeReadOnly();
			GetContactResponse._getContactResponseFieldNames = new string[]
			{
				"BaseResponse",
				"ContactCount",
				"ContactList",
				"Ret"
			};
			GetContactResponse._getContactResponseFieldTags = new uint[]
			{
				10u,
				16u,
				26u,
				34u
			};
			object.ReferenceEquals(micromsg.Proto.GetContactResponse.Descriptor, null);
		}
	}
}
